var ns;
var app = new Vue({
    el: '#app',
    data: {
        ID:0,
        CompleteDesc:'',
        writeCount:0
    },
    methods: {

        writeMsg:function(){
            var that=this;
            var testVal=that.CompleteDesc.length;
            that.writeCount=testVal;
        },
        open_save:function(){
            var that = this;
            var option={};
            option.OrderID=that.ID;
            option.IsReject=true;
            option.Remark=that.CompleteDesc;
            option.action='businessconfirmorder';
            console.log(JSON.stringify(option));
            ns.post(option, function(succeed, data, err) {
                console.log(JSON.stringify(err));
                console.log(JSON.stringify(data));
                if (succeed) {
                    if(data.status){
                        api.toast({
                            msg: '操作成功',
                            duration: 2000,
                            location: 'bottom'
                        });
                        api.sendEvent({
                            name:'shopmsgevent'
                        });
                        setTimeout(() => {
                            api.closeWin();
                        }, 300);
                    }else{
                        api.toast({
                            msg: data.Msg,
                            duration: 2000,
                            location: 'bottom'
                        });
                    }
                   
                    
                } else if (err) {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            })
        },
    }
});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    app.ID = api.pageParam.id;
    // app.get_data();
};
